package org.example.mpdemo1.utils;

import org.springframework.util.DigestUtils;

public class Utils {

    //生成随机字符串
    public static String generateUUID() {
        return java.util.UUID.randomUUID().toString().replaceAll("-", "");
    }

    //MD5加密
    public static String md5(String key) {
        if (key == null || key.length() == 0) {
            return null;
        }
        return DigestUtils.md5DigestAsHex(key.getBytes());
    }
}
